#include<stdio.h>

//https://www.nowcoder.com/practice/60d96b08e1cb42e38629d54e37eac008?tpId=290&tqId=618630&ru=/exam/oj/ta&qru=/ta/beginner-programmers/question-ranking&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D290

int main() {
    double arr[5][5];
    for (int i = 0; i < 5; ++i) {
        scanf("%lf %lf %lf %lf %lf", &arr[i][0], &arr[i][1], &arr[i][2], &arr[i][3], &arr[i][4]);
    }
    for (int i = 0; i < 5; ++i) {
        double sum = 0;
        for (int j = 0; j < 5; ++j) {
            printf("%.1f ", arr[i][j]);
            sum += arr[i][j];
        }
        printf("%.1f\n", sum);
    }
    return 0;
}
